A cache is a component that may improve performance by storing data such that future requests for that data can be served faster. The Least Recently Used (LRU) algorithms are in common use for managing which information stays in the caches and which information is discarded to allow cache spaces to be recycled for use with newer information. LRU lists may be used with hash tables to find data and free lists to manage unallocated cache space. One issue that needs to be managed is when the free list becomes depleted and additional cache spaces must be freed in order to have resources available to handle new requests. For example, this may be handled by a recycle operation that is initiated when the number of elements on the free list drops below a certain threshold. A task may be initiated to remove some number of entries from the LRU queue and reuse the cache space allocated thereto by placing the entries on the free queue. This process may proceed until another threshold is reached which stops the process.
A multi-level cache system may include smaller faster caches backed up by larger slower caches. In a multi-level cache system, fast memory technologies (e.g., dynamic random access memory (DRAM)) may be utilized to implement the primary cache. Flash technology may be utilized as a secondary cache to provide much larger cache capacities. Algorithms may be defined to determine when to move data from the primary cache and to the secondary flash cache.